home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5995 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  897 b 

  1. Path: news.iadfw.net!usenet
  2. From: alpet@airmail.net (Adam Peterson)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Do you have ever pass structures?
  5. Date: Thu, 22 Feb 1996 06:45:11 GMT
  6. Organization: customer of Internet America
  7. Message-ID: <4ggsio$343@news-f.iadfw.net>
  8. References: <4ge8mi$qjm@srvr1.engin.umich.edu>
  9. NNTP-Posting-Host: dal24-16.ppp.iadfw.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. >So is there any REAL advantage is passing an entire structure? Do people
  13. >ever do it? I've some people's source code and almost always, they
  14. >pass pointers to structures instead of the structure itself. In a way,
  15. >passing a pointer to an array instead of the array itself might be
  16. >feature not a bug in C. :)
  17.  
  18. The *disadvantage* is speed and space. Passing a pointer is just
  19. word//double word.  Passing the actual structure requires loading the
  20. stack with all the elements of the structure...slow...
  21.  
  22. Adam
  23.  
  24.  
  25.